package com.xquant.system.service;


import com.xquant.common.core.constant.ErrMsgConstant;
import com.xquant.common.core.exception.ServiceException;
import com.xquant.common.core.utils.StringUtils;
import com.xquant.common.security.annotation.RequiresPermissions;
import com.xquant.common.security.utils.SecurityUtils;
import com.xquant.system.domain.*;
import org.apache.commons.collections4.MapUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

public interface ISysUserPermService {

    public List<SysUserPerm> selectUserPermList(SysUserPerm sysUserPerm);


    public List<AccUser> selectDeptAccPermList(AccUser accUser);
    public List<AccUser> selectUserAccPermList(AccUser accUser);

    public List<GroupUser> selectUserGroupPermList(GroupUser groupUser);
    public List<GroupUser> selectDeptGroupPermList(GroupUser groupUser);

    public List<CfgUser> selectUserCfgPermList(CfgUser accUser);
    public List<CfgUser> selectDeptCfgPermList(CfgUser accUser);



    public List<IrcUser> selectUserIrcPermList(IrcUser ircUser);
    public List<IrcUser> selectDeptIrcPermList(IrcUser ircUser);

    public List<DivUser> selectUserDivPermList(DivUser divUser);
    public List<DivUser> selectDeptDivPermList(DivUser divUser);

    public List<VlsUser> selectUserVolPermList(VlsUser vlsUser);
    public List<VlsUser> selectDeptVolPermList(VlsUser vlsUser);

    public List<SysUserPerm> selectAllUserPermList();

    public SysUserPerm selectUserPermById(Long userId);

    public List<Map> selectAllAccount();
    public List<Map> selectAllGroup();
    public List<Map> selectAllCfg();

    public int deleteUserPermById(Long userId);

    public int deleteUserPermByIdS(Long[] userIds);

    public int clearUserPermDetail(Long[] userIds);

    public int insertUserPerm(SysUserPerm userPerm);

    public int updateUserPerm(SysUserPerm userPerm);

    public int edtUserAccPerm(AccUser accUser);

    public int edtUserGroupPerm(GroupUser groupUser);

    public int edtUserCfgPerm(CfgUser accUser);

    public int edtUserIrcPerm(IrcUser ircUser);

    public int edtUserDivPerm(DivUser divUser);

    public int edtUserVlsPerm(VlsUser vlsUser);

    public String getUserPermFlag(String authType,String userId);


    /**
     *必须包含uRight和dRight两个结果的List<Map> 在该方法处根据用户进行数据筛选
     * @param list
     * @param authType
     * @return
     */
    public  List<Map> filterAuth(List<Map> list,String authType);

    /**
     * 获取用户对应类型的权限标志
     * @param authType
     * @return
     */
    public  String getPermFlag(String authType);

}
